package cn.jiyun.function.service.impl;

import cn.jiyun.function.mapper.OrderBillMapper;
import cn.jiyun.function.service.OrderBillService;
import cn.jiyun.pojo.Orders;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderBillServiceImpl implements OrderBillService {
    @Autowired
    private OrderBillMapper orderBillMapper;

    @Override
    public PageInfo<Orders> findPage(Integer pageNum, Integer pageSize, Orders orders) {
        Page<Orders> orderBills = PageHelper.startPage(pageNum, pageSize);
        List<Orders> orderBillList = orderBillMapper.findPage(orderBills,orders);

        return new PageInfo<>(orderBillList);
    }

    @Override
    public Orders particulars(Integer id) {
        return orderBillMapper.particulars(id);
    }

//    @Override
//    public List<Orders> findAll() {
//        return orderBillMapper.findAll();
//    }
}
